%% copy riak-0.14.2 source to learn dynamo implementation and erlang
%% author: lichuang
-module(app_helper).

-export([get_env/1, get_env/2, get_env/3]).

get_env(App) ->
  application:get_all_env(App).

get_env(App, Key) ->
  get_env(App, Key, undefined).

get_env(App, Key, Default) ->
  case application:get_env(App, Key) of
    {ok, Value} ->
      Value;
    _ ->
      Default
  end.
